﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;

namespace UnitTests
{
    [TestClass()]
    public class ParsePhoneNumbersTest
    {
        public const string IN_FILENAME = @"D:\Downloads\Games\UNI\Telerik\NetEssentials\Elian Kurtenkov\SampleIntermediateExam_2\ParsePhone\bin\Debug\test.txt";
        public const string OUT_FILENAME = @"D:\Downloads\Games\UNI\Telerik\NetEssentials\Elian Kurtenkov\SampleIntermediateExam_2\ParsePhone\bin\Debug\phones.txt";
        public const string EXPECTED_FILENAME = @"D:\Downloads\Games\UNI\Telerik\NetEssentials\Elian Kurtenkov\SampleIntermediateExam_2\ParsePhone\bin\Debug\expected.txt";
        [TestMethod()]
        public void MergedFileExistTest()
        {
            ParsePhoneNumbers.ExtractNumbersBigFile(IN_FILENAME, OUT_FILENAME);
            using (StreamReader reader_output = new StreamReader(OUT_FILENAME))
            {
                using (StreamReader reader_expected = new StreamReader(OUT_FILENAME))
                {
                    string output = reader_output.ReadToEnd();
                    string expected = reader_expected.ReadToEnd();
                    Assert.IsTrue(output.Equals(expected));
                }
            }
        }
    }
}
